package com.huluobo.mvvm.viewmodel;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;

import com.huluobo.mvvm.model.BaseRepo;

/**
 * Created by LC on 2023/9/14.
 */
public abstract class BaseViewModel<Repo extends BaseRepo> extends AndroidViewModel {
    //public abstract class BaseViewModel<model extends BaseViewModel>

    //上下文
    protected Application application;

    //数据仓库
    protected Repo repo;
    // protected model model;


    public BaseViewModel(@NonNull Application application) {
        super(application);
        this.application = application;
        repo = createRepo();
    }

    protected abstract Repo createRepo();
    //protected abstract model createModel();
}
